package cn.myfirefly.moming.house.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSONObject;

import cn.myfirefly.core.BaseController;
import cn.myfirefly.core.model.ResultDto;

@Controller
public class IndexController extends BaseController {
	@RequestMapping(value = "/main.do")
	public String toMain(HttpServletRequest request,
			HttpServletResponse response) {
		String strMenus = (String)request.getSession().getAttribute("menus");
		ResultDto resultDto = JSONObject.parseObject(strMenus, ResultDto.class);
		request.setAttribute("menus", resultDto.getData());
		return "main";
	}
	
	@RequestMapping("/myhome.do")
	public String welcome(HttpServletRequest request, 
			HttpServletResponse response) {
		
		return "myhome";
	}
}
